package com.wxzz.elearing.course.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxzz.elearing.course.entity.CurriculumSectionTopic;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 课程章节测评试题 Mapper 接口
 * </p>
 *
 * @author
 * @since 2021-03-10
 */
public interface CurriculumSectionTopicMapper extends BaseMapper<CurriculumSectionTopic> {

    /**
     * 根据章节id或在线考试id查询测试题
     * @param curriculumSectionId
     * @return
     */
    @Select("SELECT * FROM `curriculum_section_topic` WHERE curriculum_section_id = #{curriculumSectionId} AND topic_category = #{topicCategory} AND deleted = 0")
    List<CurriculumSectionTopic> listCurriculumSectionTopicByCurriculumSectionId(@Param("curriculumSectionId") Long curriculumSectionId,@Param("topicCategory") Integer topicCategory);
}
